<?php $this->load->view("general/header");?>
<div id="customer" class="page_">
    <div class="form">              
        <div class="form_header">Bayar Sewa Mobil ke Owner Mobil</div>
        <div class="form_header_right"></div>
        
        <div class="form_header_right1"></div>
        <div class="content_dataS">
        <form method="post" action="<?php echo site_url("car/leasing");?>">
            <div class="content_dataR">
           		
               
                <div class="row">
                    <div class="col1"></div>
                    <div class="col2"> 
                        <div class="errorField"></div>
                    </div>
                </div>
                
                 <input type="button" value="Hitung Cicilan" class="button_red" onclick="javascript:fadeInHitung('#hitung', '0')"/>
                 <div id="hitung" style="display:none">
                 	<div class="row">
                    	<div class="col1"> Harga Mobil (Rp)</div>
                        <div class="col2"><input type="text" name="harga" id="cicilanHarga" onkeyup="javascript:cicilanHargaFunc(this.form, this.value)"/>	</div>
                        <div class="col3" id="cicilanHargaJava"></div>
                       
                        
                    </div>
                    <div class="row">
                    	<div class="col1"> DP (%)</div>
                        <div class="col2"><input type="text" name="depan" id="cicilanDp" onkeyup="javascript:cicilanDpFunc(this.form)"/></div>
                        <div class="col4" id="cicilanHargaDP"></div>
                    </div> 
                    <div class="row">
                        <div class="col1">Lama Cicilan</div>
                        <div class="col2">
                        	<select name="thn" style="width:100%" id="lamatahun" onchange="javascript:cicilanBunga(this.form)">							
                                <option selected="selected">::: Pilih Lama Cicilan(Tahun) :::</option>
                                <option value="1">1 Tahun</option>
                                <option value="2">2 Tahun</option>
                                <option value="3">3 Tahun</option>
                                <option value="4">4 Tahun</option>
                                <option value="5">5 Tahun</option>
                                <option value="6">6 Tahun</option>                                              
                   			</select> <input type="text" name="bungaHidden" id="bungaHid" style="display:none" /> </div>
                        <div class="col3" id="cicilanHargaDPJava"></div>
                	</div>
                    <div class="row">
                    	<div class="col1"> Bunga (%)</div>
                        <div class="col2"><input type="text" name="bunga" id="bunga" onkeyup="javascript:cicilanBunga(this.form)"/>
                        
                        </div>
                        <div class="col4" id="cicilanBungaJava"></div>
                    </div> 
                    <div class="row">
                        <div class="col1"></div>
                        <div class="col2"><input type="text" name="bungaHidden" id="bungaHid" style="visibility:hidden" /></div>
                         <div class="col3" id="cicilanDPBungaJava"></div>
                	</div>
                    <div class="row">
                    	<div class="col1"> Cicilan/bulan</div>
                        <div class="col2"><input type="text" name="bungaHidden" id="bungaHid" style="visibility:hidden" /><input type="text" name="dpHidden" id="dpHid" style="display:none" />
                        
                        </div>
                        <div class="col3" id="cicilanPerBulan"></div>
                    </div>
                    <div  style="border-bottom:solid; width:90%"><strong>Pembayaran Awal</strong></div>
                    <div class="row">
                    	<div class="col1"> DP </div>
                        <div class="col2"><input type="text" name="dpBayar1" id="bayarDP" disabled="disabled"/></div>
                        <div class="col3" id="cicilanHargaDPBayar"></div>
                    </div>
                    <div class="row">
                    	<div class="col1">Angsuran </div>
                        <div class="col2"><input type="text" name="angsuran" id="angsuran" disabled="disabled"/> </div>
                        <div class="col3" id="angsuran1"></div>
                    </div>
                    <div class="row">
                    	<div class="col1">Adm </div>
                        <div class="col2"><input type="text" name="adm" id="adm" onkeyup="javascript:cicilanAdm(this.form)"/> </div>
                        <div class="col4" id="admUI"></div>
                    </div>
                    <div class="row">
                        <div class="col1"></div>
                        <div class="col2"><input type="text" name="cicilanPerBulanBayar" id="cicilanPerBulanBayar" style="visibility:hidden" /><input type="text" name="bayarHid" id="bayarHid" style="display:none" /></div>
                         <div class="col3" id="bayar"></div>
                	</div>
                    <div class="row">
                    	<div class="col1">Diskon </div>
                        <div class="col2"><input type="text" name="diskon" id="diskon" onkeyup="javascript:diskonFunc(this.form)"/> </div>
                        <div class="col4" id="diskonUI"></div>
                    </div>
                    <div class="row">
                        <div class="col1">Pembayaran Awal</div>
                        <div class="col2"><input type="text" name="hiddenTotal" id="hiddenTotal" style="visibility:hidden" /></div>
                        <div class="col3" id="bayarAkhir" align="right"></div>
                	</div>
                 </div>
                              
            </div>
            <div  style="border-bottom:solid; width:80%"><strong>Data Mobil</strong></div>
            <div class="row">
            	<div class="col1">Staff</div>
                <div class="col2"><?php echo get_username($this->session->userdata("user_id"));?> 
                	
                </div>
			</div>
            
            <div class="row">
            	<div class="col1">Nomor Polisi</div>
                <div class="col2"><input type="text" name="plat_mobil" /> 
                	<div class="errorField"><?php echo form_error("plat_mobil");?></div>
                </div>
			</div>

            <div class="row">
            	<div class="col1">Produsen</div>
                <div class="col2" id="produsenPlace">
                	<select id="produsen" name="produsen">
                    <option value="" selected="selected">Pilih nama produsen</option>
                    	<?php foreach ($produsen as $produsen1){?>
                        <option value="<?php echo $produsen1['nama']?>"><?php echo $produsen1['nama']?></option>
                        <?php } ?>
                    </select>
                	
                </div><div class="errorField"><img src="<?php echo base_url();?>image_tinymce/add.jpg" id="refreshimgProd"/></div>
			</div>
            <div class="row">
            	<div class="col1">Tipe</div>
                <div class="col2">
               	 	<select id="tipe" name="tipe">
                    	<option value="" selected="selected">Pilih tipe mobil</option>
                    	<option value="Sedan">Sedan</option>
                        <option value="MPV">MPV</option>
                        <option value="SUV">SUV</option>                
                    </select>
                	<div class="errorField"><?php echo form_error("tipe");?></div>
                </div>
			</div>
            <div class="row">
            	<div class="col1">Model</div>
                <div class="col2"><input type="text" name="model" /> 
                	<div class="errorField"><?php echo form_error("model");?></div>
                </div>
			</div>
        	<div class="row">
            	<div class="col1">Series</div>
                <div class="col2"><input type="text" name="nama_mobil" /> 
                	<div class="errorField"><?php echo form_error("nama_mobil");?></div>
                </div>
            </div>
			<div class="row">
            	<div class="col1">Warna Mobil</div>
                <div class="col2"><input type="text" name="warna" /> 
                	<div class="errorField"><?php echo form_error("warna");?></div>
                </div>
			</div>
           	<div class="row">
                <div class="col1">Daya Angkut</div>
                <div class="col2">
                	<select id="daya" name="daya">
                    	<option value="" selected="selected">Pilih daya angkut</option>
                       <option value="5">5 Orang</option>
                        <option value="7">7 Orang</option>
                        <option value="10">10 Orang</option>
                        <option value="12">12 Orang</option>                   
                    </select> 
                    <div class="errorField"><?php echo form_error("daya");?></div>
                </div>
            </div>
            <div class="row">
                <div class="col1">Mesin</div>
                <div class="col2"><input type="text" name="mesin" /> cc
                    <div class="errorField"><?php echo form_error("mesin");?></div>
                </div>
            </div>
            <div class="row">
                <div class="col1">Transmisi</div>
                <div class="col2">
                	<select id="transmisi" name="transmisi">
                    	<option value="" selected="selected">Pilih jenis transmisi</option>
                        <option value="Automatic">Automatic</option>
                    	<option value="Manual">Manual</option>               
                    </select> 
                    <div class="errorField"><?php echo form_error("transmisi");?></div>
                </div>
            </div>          
            <div class="row">
                <div class="col1">Bahan bakar</div>
                <div class="col2">
                	<select id="bensin" name="bensin">
                    	<option value="" selected="selected">Pilih jenis bahan bakar</option>
                        <option value="Premium">Premium</option>
                    	<option value="Pertamax">Pertamax</option>  
                        <option value="Bio Solar">Bio Solar</option>                
                    </select>
                    <div class="errorField"><?php echo form_error("bensin");?></div>
                </div>
            </div>
        	<div class="row">
                <div class="col1">Tahun Pembuatan</div>
                <div class="col2"><input type="text" name="tahun"/> 
                    <div class="errorField"><?php echo form_error("tahun");?></div>
                </div>
            </div>

            <div class="row">
                <div class="col1">Masa Berlaku STNK</div>
                <div class="col2">
                	Tgl 
                    <select id="tgl" name="tgl" style="width:18%">
                        <?php for($i=1;$i<32;$i++){?>
                            <option value="<?php if($i<10){echo 0;} echo $i;?>"><?php  echo $i;?></option>
                        <?php }?>                   
                    </select>
                    Bln 
                    <select id="bln" name="bln" style="width:18%">
                        <?php for($i=1;$i<13;$i++){?>
                            <option value="<?php if($i<10){echo 0;} echo $i;?>"><?php  echo $i;?></option>
                        <?php }?>                   
                    </select>
                    
                    Thn
                    <select name="thn" style="width:30%">
                        <?php for($i=date("Y")-10;$i<date("Y")+10;$i++){?>
                            <option value="<?php echo $i;?>"><?php if($i<10){echo 0;} echo $i;?></option>
                        <?php }?>                   
                    </select> 
                    <div class="errorField"><?php echo form_error("masa_stnk");?></div>
                </div>
            </div>
            <div class="row">
                <div class="col1">Leasing Company</div>
                <div class="col2">
                    <select id="nama_pemilik" name="nama_pemilik">
                        <option value="" selected="selected">Pilih Leasing Company</option>
                        <?php foreach ($owner as $owner1){?>
                            <option value="<?php echo $owner1['owner_id'];?>"><strong><?php echo $owner1['owner_name'];?></option>
                        <?php }?>
                    </select>
                    <div class="errorField"><?php echo form_error("tarif");?></div>
                </div>
            </div>
            
            
            
            <div class="row">
                <div class="col1">Tarif Harian</div>
                <div class="col2"><input type="text" name="tarif" style="text-align:right"/> 
                    <div class="errorField"><?php echo form_error("tarif");?></div>
                </div>
            </div>
            
            
            <div class="row">
                <div class="col1">Tarif Mingguan</div>
                <div class="col2"><input type="text" name="tarifminggu" style="text-align:right"/> 
                    <div class="errorField"><?php echo form_error("tarif");?></div>
                </div>
            </div>
            <div class="row">
                <div class="col1">Tarif Bulanan</div>
                <div class="col2"><input type="text" name="tarifbulan" style="text-align:right"/> 
                    <div class="errorField"><?php echo form_error("tarif");?></div>
                </div>
            </div>
            <div class="row">
                <div class="col1">Tarif 6 Bulanan</div>
                <div class="col2"><input type="text" name="tarif6bulan" style="text-align:right"/> 
                    <div class="errorField"><?php echo form_error("tarif");?></div>
                </div>
            </div>
            <div class="row">
                <div class="col1">Tarif Tahunan</div>
                <div class="col2"><input type="text" name="tariftahun" style="text-align:right"/> 
                    <div class="errorField"><?php echo form_error("tarif");?></div>
                </div>
            </div>
            <div class="row">
                <div class="col1">Harga Car CDF</div>
                <div class="col2"><input type="text"id="mdfmobil" name="mdffuel" style="text-align:right" onkeyup="javascript: hargamdf()"/> 
                    <div class="errorField"><?php echo form_error("tarif");?></div>
                </div>
            </div>
             <div class="row">
                <div class="col1">Harga Supir CDF</div>
                <div class="col2"><input type="text" id="mdfsupir" name="mdfsupir" value="<?php echo number_format($mdf['0']['supir'], 0, '.', ',');?>" readonly="readonly" style="text-align:right" onkeyup="javascript: hargamdf()"/> <a href="#mdfsupirview" onclick="javascript: enabling()">Edit</a>
                    <div class="errorField"><?php echo form_error("tarif");?></div><div id="mdfsupirview"></div>
                </div>
            </div>
             <div class="row">
                <div class="col1">Harga Fuel CDF</div>
                <div class="col2"><input type="text" name="mdffuel" id="mdffuel" value="<?php echo number_format($mdf['0']['fuel'], 0, '.', ',');?>"   readonly="readonly" style="text-align:right" onkeyup="javascript: hargamdf()"/> <a href="#mdffuelview" onclick="javascript: enablingfuel()">Edit</a><div id="mdffuelview" onkeyup="javascript: hargamdf()"></div>
                    <div class="errorField"><?php echo form_error("tarif");?></div>
                </div>
            </div>
            <div class="row">
                <div class="col1">Harga Paket CDF</div>
                <div class="col2"><input type="text" name="tarifmdf" id="mdftotal" style="text-align:right"/> 
                    <div class="errorField"><?php echo form_error("tarif");?></div>
                </div>
            </div>
        </div>   
        <div class="title" align="right">
            <input type="submit" name="btnSave" value="Save" class="button_red" />
        </div>
        <div class="success"><?php echo (isset($success))?$success:"";?>&nbsp;</div>
        </form>
        
        
        <div id="dialog-formProdusen" title="Tambah Data Produsen Mobil">
    	<p class="validateTips">Harus diisi</p>
 
            <form>
            <fieldset>
                <label for="name">Nama Produsen</label>
                <input type="text" name="name" id="name" class="text ui-widget-content ui-corner-all" />
               
            </fieldset>
            </form>
        </div>
        
    </div>
</div>
<?php $this->load->view("general/footer");?>